package com.shop.loan.service.impl;

import com.shop.loan.model.Question;
import com.shop.loan.model.common.ResResult;
import com.shop.loan.service.QuestionService;
import org.springframework.stereotype.Service;
import xyz.erupt.core.query.EruptQuery;
import xyz.erupt.core.service.EruptCoreService;
import xyz.erupt.core.service.IEruptDataService;
import xyz.erupt.core.view.Page;

import javax.annotation.Resource;

@Service
public class QuestionServiceImpl implements QuestionService {

    @Resource
    IEruptDataService eruptDataService;

    @Override
    public ResResult list() {
        EruptQuery eruptQuery = EruptQuery.builder().build();
        Page page = eruptDataService.queryList(EruptCoreService.getErupt(Question.class.getSimpleName()),
                new Page(1, 50), eruptQuery);
        return new ResResult(page);
    }
}
